#pragma once
#include "purchase_order.hpp"
#include "entity_access/index.hpp"
#include "supply_order.hpp"
#include "material_product_storage.hpp"
#include "view_purchase_order.hpp"
#include "material_product_check.hpp"
#include "sale_order.hpp"
#include "produce_order.hpp"
#include "material_use_order.hpp"
#include "view_produce_order.hpp"
#include "product_complete_order.hpp"
#include "product_storage.hpp"
#include "install_order.hpp"
#include "product_accessory_check.hpp"
#include "view_sale_order.hpp"
#include "view_purchase_count.hpp"
#include "view_purchase_product_count.hpp"
#include "view_sale_count.hpp"
#include "view_sale_product_count.hpp"
#include "view_sale_profit_count.hpp"
#include "view_product_complete_count.hpp"
#include "view_material_use_count.hpp"
#include "view_material_product_stock_count.hpp"
#include "view_product_accessory_stock_count.hpp"

namespace components2 {
    void setAdminUserEntity() {
        auto adminUser = entity_access::EntityType::GetEntityType("AdminUser");
        auto p = entity_access::Property("EmployeeId", typeid(string));
        adminUser->Properties.emplace_back(p);

        auto viewAdminUser = entity_access::EntityType::GetEntityType("ViewAdminUser");
        auto p2 = entity_access::Property("EmployeeName", typeid(string));
        viewAdminUser->Properties.emplace_back(p2);
    }

    void InitComponentInstances() {
        setAdminUserEntity();
        PurchaseOrder::SetInstance();
        SupplyOrder::SetInstance();
        MaterialProductStorage::SetInstance();
        ViewPurchaseOrder::SetInstance();
        MaterialProductCheck::SetInstance();
        SaleOrder::SetInstance();
        ProduceOrder::SetInstance();
        MaterialUseOrder::SetInstance();
        ViewProduceOrder::SetInstance();
        ProductCompleteOrder::SetInstance();
        ProductStorage::SetInstance();
        InstallOrder::SetInstance();
        ProductAccessoryCheck::SetInstance();
        ViewSaleOrder::SetInstance();
        ViewPurchaseCount::SetInstance();
        ViewPurchaseProductCount::SetInstance();
        ViewSaleCount::SetInstance();
        ViewSaleProductCount::SetInstance();
        ViewSaleProfitCount::SetInstance();
        ViewProductCompleteCount::SetInstance();
        ViewMaterialUseCount::SetInstance();
        ViewMaterialProductStockCount::SetInstance();
        ViewProductAccessoryStockCount::SetInstance();
    }
}
